/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-  */
/*
 * catchit
 * Copyright (C) 2013 Ryan Grinkewitz <graphite@Toto>
 */

#ifndef _Q_LEARNING_H_
#define _Q_LEARNING_H_

#include <stdlib.h>     
#include <time.h> 
#include <string>
#include <fstream>
#include <sstream>

class QLearning
{
public:
	QLearning(int stateSize,int actionSize, float learningRate, int discountFactor);
	~QLearning();

	//Basic flow
	void setCurrentState(int state);
	int getAction();
	void updateQFunction(int newState, float reward);

	void setReward(int state, int action, float reward);
	void readQFunctionTable(std::string qFunctionTable);
	void writeQFunctionTable(std::string qFunctionTable);
	
protected:

private:
	int stateSize;
	int actionSize;

	float learningRate;
	float discountFactor;

	int currentState;
	int currentAction;
	
	float** rewards;

};

#endif // _Q_LEARNING_H_

